<div>
 <li id="post-<%=post.id%>">
   <%= gravatar_for(post.user,size:40)%>
   <!--<#%= post.user.name%>-->
   <%= post.content%>
   <p>
     <%= content_tag(:span,"#{post.likes.count} likes", id: "post_#{post.id}_likes" )%>
     <%if is_loged_in? %>
        <%= link_to 'like',post_likes_path(post),method: :post,remote:true %>
			<% if @shadow.eql?('profile')&& is_current_user?(@user) %>
				 <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#<%= post.id%>">
				添加到分类
				</button>
			<%end%>
			<br>
     <%end%>
     <span style="color: cornflowerblue">
     <%= is_current_user?(post.user) ? "我":"#{post.user.name}" %>
     </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发布于 <%= time_ago_in_words(post.created_at)%>之前
   </p>
    <%if current_user.admin? || is_current_user?(post.user)%>
       <%=link_to '删除',post,method: :delete,data:{confirm:"确定删除?"}%>
    <%end%>
   <hr style="border-top: 1px solid lightgray">
 </li>
<% if @shadow.eql?('profile') %>
 <div class="modal  fade" id="<%=post.id%>" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="">
	<div class="modal-dialog " style="width: 400px">
	 <div class="modal-content">
		<div class=" modal-header">
		 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
			&times;
		 </button>
		 <h4 class="modal-title" id="myModalLabel">
			增加分类<%= post.id%>
		 </h4>
		</div>
		<%= form_for :article_tag,url: {action: 'add_article_to_tag',controller: 'users'}  do |f|%>
			<div class="modal-body">
			 <!--<input type="text" name="article_type" class="form-control input-lg"/>-->
			 <%if @tags.present?%>
				 <div id="parent">
					<%= select_tag("select_tag",options_for_select(@tags))%>
			 <%end%>
			 </div>
			 <input type="hidden" name="post_num" value="<%=post.id%>" />
			</div>
			<div class="modal-footer">
			 <button type="button close" class="btn btn-default" data-dismiss="modal">关闭</button>
			 <%= f.submit '添加',class: 'btn btn-primary'%>
			</div>
		<%end%>

	 </div>
	</div>
 </div>
 <%end%>
</div>